﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:markup="clr-namespace:Elysium.Markup"
                    xmlns:params="clr-namespace:Elysium.Parameters">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Themes/SharedResources.xaml"/>
        <ResourceDictionary Source="pack://application:,,,/Themes/Scrolls/ScrollBar.Buttons.xaml"/>
        <ResourceDictionary Source="pack://application:,,,/Themes/Scrolls/ScrollBar.Thumb.xaml"/>
        <ResourceDictionary Source="pack://application:,,,/Themes/Scrolls/ScrollBar.HorizontalTemplate.xaml"/>
        <ResourceDictionary Source="pack://application:,,,/Themes/Scrolls/ScrollBar.VerticalTemplate.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="{x:Type ScrollBar}">
        <Setter Property="Background" Value="{markup:ThemeResource TransparentBrush}"/>
        <Setter Property="BorderBrush" Value="{markup:ThemeResource NormalBrush}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Focusable" Value="False"/>        
        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>        
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.DefaultPaddingValue), Mode=OneWay, Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter=Bottom}"/>
                <Setter Property="MinHeight" Value="6"/>
                <Setter Property="Height" Value="6"/>
                <Setter Property="MaxHeight" Value="10"/>                
                <Setter Property="Template" Value="{StaticResource HorizontalScrollBarTemplate}"/>                
            </Trigger>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.DefaultPaddingValue), Mode=OneWay, Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter=Right}"/>
                <Setter Property="MinWidth" Value="6"/>
                <Setter Property="Width" Value="6"/>
                <Setter Property="MaxWidth" Value="10"/>
                <Setter Property="Template" Value="{StaticResource VerticalScrollBarTemplate}"/>
            </Trigger>
        </Style.Triggers>        
    </Style>

</ResourceDictionary>